<template>
  <div>
    <dynForm
      ref="dataForm"
      :info-form="searchForm"
      :search-tags="searchTags"
      :is-inline="false"
      :select-list="selectList"/>
    <h3>Physical information</h3>
    <dynTable
      ref="dynTable"
      :loading="false"
      :table-data="tableList"
      :table-columns="tableColumns"
    />
  </div>
</template>

<script>
export default {
  name: 'PhysicalTable',
  components: {},
  mixins: [],
  props: {
    tableForm: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
      tableColumns: [
        { prop: 'eqpId', label: 'eqpID' },
        { prop: 'binNo', label: 'binNo' },
        { prop: 'binItem', label: 'BinItem' },
        { prop: 'binQty', label: 'Bin Qty' },
        { prop: 'binType', label: 'BinType', templete: (_scope) => {
          return (
            <span>{ _scope.row.binType ? 'Pass' : 'Fail' }</span>
          )
        } },
        // { prop: 'binType', label: 'System Time', width: '140px' },
        { prop: 'isHardBin', label: 'Is HardBin', templete: (_scope) => {
          return (
            <span>{ _scope.row.isHardBin ? 'H' : 'S' }</span>
          )
        } }],
      searchTags: [
        { label: 'TestedQty', prop: 'testedQty', tag: 'DynInput' },
        { label: 'TMS PassQty', prop: 'passQty', tag: 'DynInput' },
        { label: 'TMS Yield', prop: 'yield', tag: 'DynInput' },
        { label: 'InputTestedQty', prop: 'inputTestedQty', tag: 'DynInput' },
        { label: 'Input PassQty', prop: 'inputPassQty', tag: 'DynInput' },
        { label: 'Input Yield', prop: 'inputYield', tag: 'DynInput' },
        { label: '是否为中断Lot', prop: 'interrupt', tag: 'DynSelect', translate: true },
        { label: '结批人员', prop: 'trackOutUser', tag: 'DynInput' }
      ],
      selectList: {}
    }
  },
  computed: {
    tableList() {
      return this.tableForm.pyhsicalDataBins
    },
    searchForm() {
      return Object.assign({}, this.tableForm)
    }
  }
}
</script>

<style scoped lang="scss">
@import "~@/assets/styles/defaultStyle.scss";
</style>
